home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
QBWIZ12.ARJ
/
QBWIZ.DOC
< prev
next >
Wrap
Text File
|
1991-02-20
|
6KB
|
137 lines
The QuickBASIC Wizard's Library
QBWIZ Copyright (c) 1990-1991 Thomas G. Hanlin III
This is QBWIZ, an assembly language library for use with QuickBASIC and
BASCOM. It was tested under QB 4.5 and is expected to work with QuickBASIC
versions 4.0 - 4.5 and BASCOM 6.0. Due to strong dependency on the internals
of the compiler, QBWIZ probably will not work with other versions. QBWIZ is
only for stand-alone compiled programs. It will not work with programs that
require the runtime module (BRUNxx) or inside the QB environment.
The QBWIZ collection is copyrighted and may be distributed only under the
following conditions:
1) No fee of over $10.00 may be charged for distribution. This applies
to physical copies and is not meant to prevent distribution by
telecommunications services.
2) All QBWIZ files must be distributed together in original, unaltered
form. This includes ACCESS.BI, ACCESS.LIB, CREATE.BAT, EXAMPLE.BAS,
FILES.LST, QBWIZ.DOC, QBWIZ.MAN, QBWIZ.NEW, and SOURCE.ZIP.
You use this library at your own risk. It has been tested by me on my own
computer, but I will not assume any responsibility for any problems which
QBWIZ may cause you. If you do encounter a problem, please let me know about
it, and I will do my best to verify and repair the error.
The accompanying source code is designed for the OPTASM assembler by SLR
Systems and may require minor modifications to assemble under MASM or TASM.
Note that QBWIZ will work only with stand-alone compiled BASIC programs, that
is, programs compiled with the /O switch.
The QBWIZ library provides a way to access many of QuickBASIC's internal
variables, which is useful in general and can be especially handy in writing
generic subprograms. The information provided allows subprograms to do
whatever they may need to do and reset the original values when they exit.
Among the information that may be accessed is what the current screen colors
are, whether the cursor is visible (and if so, what size it is), what the
current display pages are, whether redirection is in effect, and so forth.
It is also possible to set certain values, like the error level to return to
DOS when your program finishes.
Libraries
If you are not familiar with libraries, you're missing a good thing. A
library is a collection of routines. These may be subprograms or functions
written in BASIC and compiled to .OBJ format, assembly language routines, or
even routines written in Microsoft C, Fortran or Pascal using the "mixed
language" calling conventions. When your program is compiled, you can LINK
it with one or more libraries. The LINK utility will automatically take the
routines that you use from the library and add them to your program. A
library is a great way to put together a set of standard routines which you
use frequently. Libraries of this sort can also be obtained from your local
BBS or purchased outright. Among the better general-purpose libraries
available from BBSes are BASDLX, PBCLON and QB4BAS. GLIB is also fairly
good, but it's a "demo" library which can't be used to create an .EXE file.
Commercial libraries are available from AJS Publishing, Crescent Software,
and MicroHelp, among other vendors.
If you were to LINK a normal BASIC program, you'd probably type something
like this:
LINK program;
To use the functions in the provided ACCESS.LIB, you would type something
like this instead:
LINK program,,NUL,ACCESS;
You can use multiple libraries very easily:
LINK program,,NUL,ACCESS+anylib;
QuickBASIC Access Functions
The QuickBASIC Access Functions are contained in the ACCESS.LIB library. The
function declaration information for this library is contained in ACCESS.BI,
which should be included at the top of your programs. Either copy ACCESS.BI
directly into your program or use an include statement:
REM $INCLUDE: 'ACCESS.BI'
These functions allow you to obtain information from QuickBASIC's internal
variables. Many useful values can be obtained this way that would not be
available otherwise.
The following functions are available:
ACTPAGE% active display page (the one read from and written to)
BACKCOLOR% current text background color
BORDERCOLOR% current border color
COLORBURST% whether color burst is on: 0 no, -1 yes
COMMANDLINE$ original command line (not converted to uppercase)
CRT$ type of display adapter ("MDA", "CGA", "EGA", or "VGA")
CURSORSTART% starting cursor scan line, if the cursor is visible
CURSORSTOP% ending cursor scan line, if the cursor is visible
DEFSEG% data segment defined by DEF SEG
FORECOLOR% current text foreground color
PRINTERWIDTH% width of the printer (columns)
REDIRECTION% whether output is redirected: 0 no, -1 yes
SCREENHEIGHT% height of the screen (rows)
SCREENMODE% current BASIC screen mode
SCREENWIDTH% width of the screen (columns)
SHOWCURSOR% whether the cursor is visible: 0 no, -1 yes
VIEWBOTTOM% bottom row of the screen (according to VIEW PRINT info)
VIEWTOP% top row of the screen (according to VIEW PRINT info)
VISPAGE% visible display page (the one displayed on the screen)
QuickBASIC Access Subprograms
The QuickBASIC Access Subprograms are contained in the ACCESS.LIB library.
The function declaration information for this library is contained in
ACCESS.BI, which should be included at the top of your programs. Either copy
ACCESS.BI directly into your program or use an include statement:
REM $INCLUDE: 'ACCESS.BI'
These subprograms allow you to alter information in QuickBASIC's internal
variables. This allows you to accomplish some things that might not
otherwise be possible.
The following subprograms are available:
ERRLEVEL(x%) error level to return to DOS when the program ends (0-255)